package com.zp.crm.dto.Marketing;

import java.text.SimpleDateFormat;
import java.util.List;

import com.zp.crm.entity.Marketing.MarketingEntity;

public class MarketingDto {

	public String Text(int selectcount, List<MarketingEntity> list,int page,int inputI) {
		
		SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		
		String b=null;
		
		StringBuffer a=new StringBuffer();
		
		for(MarketingEntity mar : list){
			
			a.append("<tr><td>"+mar.getCode()+"</td><td>"+mar.getMarName()+"</td><td>"+mar.getMarmak()+"</td><td>"+mar.getMarPhoneName()+"</td><td>"+mar.getMarPhone()+"</td><td>"+f.format(mar.getMarCreateTime())+"</td>");
			
			if(mar.getMarzpstuts() != null && !mar.getMarzpstuts().equals("")){
				a.append("<td>"+mar.getMarzpstuts()+"</td>");
			}else{
				a.append("<td></td>");
			}
			
			a.append("<td><a class='inner_btn MarEditOn'>编辑</a><a class='inner_btn MarDeleteOn'>删除</a></td>");
			
			a.append("</tr>");
			
		}
		
		if(list.size()==0){
			
			a.append("<tr><td style='text-align:center ;'colspan='8'>暂无查询信息</td></tr>");
		}
		
		a.append("</table>");
	
		int c=selectcount/10;
		
		int o=selectcount%10;
		
		if(c==0 || o>0){
			c=c+1;
		}
		
		a.append("<aside class='paging'>");
		
		a.append("<span class=''>当前第"+page+"页</span>---");
		
		a.append("<input type='hidden' id='AInputPage' value='"+page+"'/>");
		
		if(inputI==0){
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}else{
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}
		
		a.append("<span class=''>共有"+c+"页</span>");
		
		if(c==0||c==1){
			a.append("<a class='PageIndexA'>1</a>");
		}else{ 
			int p=c+1;
			for(int i=1;i<p;i++){
				a.append("<a class='PageIndexA'>"+i+"</a>");
			};
		}
		
		a.append("</aside>");
		
		b=a.toString();
		
		return b;
	}
	
	
	public String DevelopText(int selectcount, List<MarketingEntity> list,int page,int inputI){
		SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		
		String b=null;
		
		StringBuffer a=new StringBuffer();
		
		for(MarketingEntity mar : list){
			
			a.append("<tr><td>"+mar.getCode()+"</td><td>"+mar.getMarName()+"</td><td>"+mar.getMarmak()+"</td><td>"+mar.getMarPhoneName()+"</td><td>"+mar.getMarPhone()+"</td><td>"+f.format(mar.getMarCreateTime())+"</td>");
			
			if(mar.getMarzpstuts() != null && !mar.getMarzpstuts().equals("")){
				a.append("<td>"+mar.getMarzpstuts()+"</td>");
			}else{
				a.append("<td></td>");
			}
			
			a.append("<td><a class='inner_btn DevelopUp'>执行</a><a class='inner_btn DevelopEdit'>开发</a></td>");
			
			a.append("</tr>");
			
		}
		
		if(list.size()==0){
			
			a.append("<tr><td style='text-align:center ;'colspan='8'>暂无查询信息</td></tr>");
		}
		
		a.append("</table>");
	
		int c=selectcount/10;
		
		int o=selectcount%10;
		
		if(c==0 || o>0){
			c=c+1;
		}
		
		a.append("<aside class='paging'>");
		
		a.append("<span class=''>当前第"+page+"页</span>");
		
		a.append("<input type='hidden' id='AInputPage' value='"+page+"'/>");
		
		if(inputI==0){
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}else{
			a.append("<input type='hidden' id='CreateTypeInputHidden' value='"+inputI+"'/>");
		}
		
		a.append("<span class=''>共有"+c+"页</span>");
		
		if(c==0||c==1){
			a.append("<a class='PageIndexA'>1</a>");
		}else{ 
			int p=c+1;
			for(int i=1;i<p;i++){
				a.append("<a class='PageIndexA'>"+i+"</a>");
			};
		}
		
		a.append("</aside>");
		
		b=a.toString();
		
		return b;
	}

}
